<?
require_once('common.php');
require_once('../bin/db.php');

$table=$_POST['table'];
$url=$_POST['url'];
$db= new MySQL_Class();
$db->Create();
	
while (list ($key, $val) = each ($_POST['pub'])) {
		if (!is_numeric($val)) $val="'".$val."'";
		$sql="update $table set publish=$val where id=$key;";
		$db->Query("update $table set publish=$val where id=$key;");
}

if (!(isset($_POST['nonew'])&&$_POST['nonew']=='1')) {

	while (list ($key, $val) = each ($_POST['new'])) {
		$db->Query("update $table set mark_new='$val' where id=$key;");
	}

}	

while (list ($key, $val) = each ($_POST['auth'])) {
		if (!is_numeric($val)) $val="'".$val."'";
		$sql="update $table set auth=$val where id=$key;";
		$db->Query("update $table set auth=$val where id=$key;");
}


header("Location: $url");
exit();
?>